//package com.woniuxy.xiangruicommonutilserver.config;
//
//import com.woniuxy.xiangruicommonutilserver.bean.MailBean;
//import com.woniuxy.xiangruicommonutilserver.dao.MailDao;
//import org.springframework.context.annotation.Bean;
//import org.springframework.mail.javamail.JavaMailSender;
//import org.springframework.mail.javamail.JavaMailSenderImpl;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//
///**
// * @author: masterhai
// * @date: 2021/4/19:9:41
// * @description:我的邮件发送配置类
// */
//@Component
//public class MyMailConfig {
//    @Resource
//    private MailDao mailDao;
//
//    @Bean
//    public JavaMailSender myMailSender () {
//        JavaMailSenderImpl sender = new JavaMailSenderImpl();
//        MailBean mailInfo = mailDao.getMailInfo();
//        System.out.println("查询到的数据:" + mailInfo);
//        sender.setUsername(mailInfo.getSendUser());
//        sender.setHost("smtp.qq.com");
//        sender.setPassword(mailInfo.getPassword());
//        sender.setDefaultEncoding("UTF-8");
//        return sender;
//    }
//}
